package com.springboot.blog.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.springboot.blog.interfaces.ToolInterface;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author 4vsy
 * @since 2020-12-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Pic implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "ID不能为空!",groups={ToolInterface.update.class})
    private Integer id;

    @NotBlank(message = "图片链接不能为空!",groups={ToolInterface.insert.class,ToolInterface.update.class})
    private String url;

    /**
     * 图片用在哪
     */
    private String title;

    /**
     * 最后修改时间
     */
    private LocalDateTime lastTime;

    /**
     * 文件大小
     */
    private Integer fsize;

    private String mimeType;

    private String hash;


}
